<!DOCTYPE html>
<%@page import="com.faeple.util.SessionManager"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ page language="java" contentType="text/html;  charset=utf-8" pageEncoding="utf-8"%>
<html lang="ko">
	<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	
	<title>Faeple</title>
	
	<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
	<!--[if lt IE 9]>
		<script src="/resources/js/html5shiv.js"></script>
		<script src="/resources/js/respond.min.js"></script>
	<![endif]-->
	<link href='http://fonts.googleapis.com/css?family=Alef' rel='stylesheet' type='text/css'>
	<link rel="stylesheet" href="/resources/css/font-awesome.css">
	<link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/nanumgothic.css">
	<style type="text/css">
		body {
			color:#333;
			min-height: 2000px;
		}
		.navbar-static-top {
			margin-bottom: 19px;
		}
		.list-wrapper { border: 1px solid #ccc; border-radius: 4px; padding: 12px 12px; }
		.list-size-title { color: #888; }
	</style>
</head>
<body>
<%@ include file="menu.jsp" %>

<div class="container">
	<div class="page-header">
		<h2 id="tables">오늘 접속회원</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todayLoginMember)} 명</p>
    	<div class="table-responsive">
		    <table class="table table-hover">
				<thead>
					<tr>
						<th>사진</th>
						<th>아이디</th>
						<th>이름</th>
						<th>웹사이트</th>
						<th>접속시간</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todayLoginMember) eq 0}">
						<tr>
							<td colspan="5" style="text-align: center;">오늘 접속한 회원이 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todayLoginMember) ne 0}">
						<c:forEach items="${todayLoginMember}" var="member">
							<tr>
								<td><img src="/resources/upload/profile/thumbnail/${member.profileImage}" width="60" height="60"></td>
								<td><a href="/${member.id}" target="_blank">${member.id}</a></td>
								<td>${member.name}</td>
								<td><a href="${member.website}" target="_blank">${member.website}</a></td>
								<td>${member.last_access}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
	
	<div class="page-header">
		<h2 id="tables">오늘 가입회원</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todaySignMember)} 명</p>
    	<div class="table-responsive">
		    <table class="table table-hover">
				<thead>
					<tr>
						<th>사진</th>
						<th>아이디</th>
						<th>이름</th>
						<th>웹사이트</th>
						<th>모바일</th>
						<th>가입시간</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todaySignMember) eq 0}">
						<tr>
							<td colspan="6" style="text-align: center;">오늘 가입한 회원이 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todaySignMember) ne 0}">
						<c:forEach items="${todaySignMember}" var="member">
							<tr>
								<td><img src="/resources/upload/profile/thumbnail/${member.profileImage}" width="60" height="60"></td>
								<td><a href="/${member.id}" target="_blank">${member.id}</a></td>
								<td>${member.name}</td>
								<td><a href="${member.website}" target="_blank">${member.website}</a></td>
								<td>
									<c:if test="${member.android eq 1}"><img src="/resources/img/Android-icon.png" width="25" height="25" title="안드로이드"></c:if>
								</td>
								<td>${member.joindate}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
	
    <div class="page-header">
		<h2 id="tables">오늘 탈퇴회원</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todayLeaveMember)} 명</p>
    	<div class="table-responsive">
		    <table class="table table-hover">
				<thead>
					<tr>
						<th>사유</th>
						<th>의견</th>
						<th>날짜</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todayLeaveMember) eq 0}">
						<tr>
							<td colspan="3" style="text-align: center;">오늘 탈퇴한 회원이 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todayLeaveMember) ne 0}">
						<c:forEach items="${todayLeaveMember}" var="member">
							<tr>
								<td>${member.type}</td>
								<td>${member.opinion}</td>
								<td>${member.date}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
    
	<div class="page-header">
		<h2 id="tables">오늘 등록된 게시글</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todayUploadPost)} 개</p>
    	<div class="table-responsive">
		    <table class="table table-hover">
				<thead>
					<tr>
						<th>사진</th>
						<th>제목</th>
						<th>내용</th>
						<th>성별</th>
						<th>공개</th>
						<th>시간</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todayUploadPost) eq 0}">
						<tr>
							<td colspan="6" style="text-align: center;">오늘 등록된 게시글이 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todayUploadPost) ne 0}">
						<c:forEach items="${todayUploadPost}" var="post">
							<tr>
								<td><a href="/p/${post.url}" target="_blank"><img src="/resources/upload/post/thumbnail/${post.image1}" width="60" height="60"></a></td>
								<td><a href="/p/${post.url}" target="_blank">${post.title}</a></td>
								<td><a href="/p/${post.url}" target="_blank">${post.content}</a></td>
								<td>${post.gender}</td>
								<td>
									<c:if test="${post.privacy == 2}">모두공개</c:if>
									<c:if test="${post.privacy == 1}">팔로워만</c:if>
									<c:if test="${post.privacy == 0}">비공개</c:if>
								</td>
								<td>${post.createdate}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
	
	<div class="page-header">
		<h2 id="tables">오늘 등록된 코멘트</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todayAddComment)} 개</p>
    	<div class="table-responsive">
		    <table class="table table-hover">
				<thead>
					<tr>
						<th>대상게시글</th>
						<th>내용</th>
						<th>작성자</th>
						<th>좋아요</th>
						<th>시간</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todayAddComment) eq 0}">
						<tr>
							<td colspan="5" style="text-align: center;">오늘 등록된 코멘트가 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todayAddComment) ne 0}">
						<c:forEach items="${todayAddComment}" var="comment">
							<tr>
								<td><a href="/p/${comment.url}" target="_blank"><img src="/resources/upload/post/thumbnail/${comment.image1}" width="60" height="60"></a></td>
								<td><a href="/p/${comment.url}" target="_blank">${comment.content}</a></td>
								<td><a href="/${comment.member_id}">${comment.author}</a></td>
								<td>0</td>
								<td>${comment.createdate}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
    
	<div class="page-header">
		<h2 id="tables">오늘 등록된 태그</h2>
    </div>
    <div class="list-wrapper">
    	<p class="list-size-title">총 ${fn:length(todayAddTag)} 개</p>
    	<div class="table-responsive">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>대상게시글</th>
						<th>태그명</th>
						<th>작성자</th>
						<th>시간</th>
					</tr>
				</thead>
				<tbody>
					<c:if test="${fn:length(todayAddTag) eq 0}">
						<tr>
							<td colspan="4" style="text-align: center;">오늘 등록된 코멘트가 없습니다.</td>
						</tr>
					</c:if>
					<c:if test="${fn:length(todayAddTag) ne 0}">
						<c:forEach items="${todayAddTag}" var="tag">
							<tr>
								<td><a href="/p/${tag.url}" target="_blank"><img src="/resources/upload/post/thumbnail/${tag.image1}" width="60" height="60"></a></td>
								<td><a href="/p/${tag.url}" target="_blank">${tag.name}</a></td>
								<td><a href="/${tag.member_id}">${tag.member_name}</a></td>
								<td>${tag.createdate}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
		</div>
    </div>
</div>
</body>
<script src="/resources/js/jquery-1.11.0.js"></script>
<script src="/resources/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="/resources/js/bootstrap.js"></script>
<script type="text/javascript">
	$(function(){
		$(".navbar-nav").children("li").eq(1).addClass("active");
	});
</script>
</html>